package com.zoffy.ybuhelper.fragment;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.zoffy.ybuhelper.R;
import org.jetbrains.annotations.NotNull;

public abstract class AbstractLoginFragment extends DialogFragment {
    protected TextView textView1,textView2,textView3;
    protected EditText editText1,editText2,editText3;
    protected LinearLayout layout1,layout2,layout3;
    protected Button saveAcountButton;

    @Nullable
    @org.jetbrains.annotations.Nullable
    @Override
    public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
        @SuppressLint("InflateParams") View view=inflater.inflate(R.layout.fragment_login,null,false);
        itemInit(view);
        listenerInit();
        layoutInit();
        return view;
    }
    private void itemInit(View view){
        textView1=view.findViewById(R.id.text_1);
        textView2=view.findViewById(R.id.text_2);
        textView3=view.findViewById(R.id.text_3);
        editText1=view.findViewById(R.id.input_item_1);
        editText2=view.findViewById(R.id.input_item_2);
        editText3=view.findViewById(R.id.input_item_3);
        layout1=view.findViewById(R.id.layout_item_1);
        layout2=view.findViewById(R.id.layout_item_2);
        layout3=view.findViewById(R.id.layout_item_3);
        saveAcountButton = view.findViewById(R.id.save_account);
    }
    protected abstract void layoutInit();
    protected abstract void listenerInit();


}
